﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;

namespace YasharEl.Infrastructure.ServiceModel.Messaging
{
    public sealed class MessageHeaderProviderInformation
    {
        private readonly string _messageHeaderKey;
        private readonly string _messageHeaderNamespace;
        private readonly IMessageHeaderValueProvider _messageHeaderValueProvider;

        public MessageHeaderProviderInformation(string messageHeaderKey, string messageHeaderNamespace, IMessageHeaderValueProvider messageHeaderValueProvider)
        {
            Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(messageHeaderKey), "messageHeaderKey could not be null or empty.");
            Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(messageHeaderNamespace), "messageHeaderNamespace could not be null or empty.");
            Contract.Requires<ArgumentNullException>(messageHeaderValueProvider != null, "messageHeaderValueProvider could not be null.");

            _messageHeaderKey = messageHeaderKey;
            _messageHeaderNamespace = messageHeaderNamespace;
            _messageHeaderValueProvider = messageHeaderValueProvider;
        }

        public string MessageHeaderKey
        {
            get { return _messageHeaderKey; }
        }

        public string MessageHeaderNamespace
        {
            get { return _messageHeaderNamespace; }
        }

        public IMessageHeaderValueProvider ValueProvider
        {
            get { return _messageHeaderValueProvider; }
        }
    }
}
